<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var r = prompt("请输入半径");

        function getArea(r) {
            return Math.PI * r * r;
        }

        function getLong(r) {
            return 2.0 * Math.PI * r;
        }
        console.log("半径为" + r + "的圆的周长是<br>");
        console.log(getLong(r));
        console.log("<br>半径为" + r + "的圆的面积是<br>");
        console.log(getArea(r));
    </script>
</body>

</html>